#ifndef CAMERA_H
#define CAMERA_H

#include "vector3d.h"
#include <string>

#define EZ 0
#define ES 1
#define ED 2
#define EQ 3

#define Eplus 4
#define Emoins 5

#define EW 6


class camera 
{
 public :
    camera(const Vector3D & position = Vector3D(512,512,150));

    virtual void OnMouseMotion();
    virtual void OnMouseButton();
    //virtual void OnKeyboard();

    virtual void animate(long timestep);
    virtual void setSpeed(double speed);
    virtual void setSensivity(double sensivity);

    virtual void setPosition(const Vector3D & position);
    virtual Vector3D getPosition()const;
    virtual Vector3D getTarget()const;
    virtual Vector3D getForward()const;
    virtual void look();

    virtual ~camera();

    bool _keystates[7];
    int _relX;
    int _relY;

protected:
    double _speed;
    double _sensivity;

    //vertical motion stuffs
    long _timeBeforeStoppingVerticalMotion;
    bool _verticalMotionActive;
    int _verticalMotionDirection;


    Vector3D _position;
    Vector3D _target;
    Vector3D _forward;
    Vector3D _left;
    double _theta;
    double _phi;


    void VectorsFromAngles();
};

#endif // CAMERA_H
